package com.lfy.controller;

import com.lfy.Factor.MonFactorBean;
import com.lfy.Factor.MonFactorBean2;
import com.lfy.Factor.MonFactorParse;
import com.lfy.service.VolitaleService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@RestController
public class VolitaleController {
    @Resource
    private VolitaleService v;
    private static int i =0;
    @GetMapping("put")
    public String put(){
      i=1;
        return "ok";
    }
    @GetMapping("get")
    public String get(){

            while (i==0){

            }

       return "结束";
    }
    @GetMapping("/mon")
    public String mon(String code){
        String a = v.test(code);
        return a;
    }
    @GetMapping("/bean")
    public String getBean(String name){
        MonFactorParse bean = MonFactorBean2.getBean(name);
       return bean.GetName();

    }
    @GetMapping("/be")
    public String getB(String name){
        MonFactorBean instence = MonFactorBean.getInstence();
        MonFactorParse mon = instence.getMon(name);
        return mon.WorkMon();


    }
}
